{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="{:\\think\\Url::build(\'send_notify\')}">
        <input type="hidden" name="id" value="{:isset($vo.id)?$vo.id:''}">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>通知谁：</label>
            <div class="formControls col-xs-6 col-sm-6 skin-minimal">
                <div class="radio-box">
                    <input type="radio" name="send_type" checked id="radio-1" value=1>
                    <label for="radio-1">指定会员</label>
                </div>
                <div class="radio-box">
                    <input type="radio" name="send_type" id="radio-0" value=2>
                    <label for="radio-0">全部会员</label>
                </div>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl" id="member_list">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>会员列表：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea class="textarea"   name="user_name"
                       datatype="*" placeholder="请填写成员名称，一行填写一个">{$member.name ?? ''}</textarea>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl" id='content'>
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>通知内容：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <textarea class="textarea" 
                      datatype="*" placeholder="请填写成员年龄" name="content"></textarea>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script>
    $(function () {
        $("[name='send_type'][value='{$vo.send_type ?? '1'}']").attr("checked", true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret) {
                ajax_progress(ret);
            }
        });
        
        $('input:radio[name="send_type"]').change(function(){
        	if($('input:radio[name="send_type"]:checked').val() == 1){
        		$('#member_list textarea ').attr('datatype','*');
        		$('#member_list').show();
        	}else{
        		$('#member_list textarea ').removeAttr('datatype');
        		$('#member_list').hide();
        	}
        });
    })
</script>
{/block}